mod cache;

use std::{fs, io};
use crate::cache::person;

fn main() {
    person::get_person();
    let args : Vec<String> = std::env::args().collect();
    let filepath : String = args[1].clone();
    match fs::read_to_string(filepath) {
        Ok(content) =>{
            println!("{} 内容如下：\n{}", args[1].clone(), content)
        }
        Err(e) =>{
            match e.kind() {
                io::ErrorKind::NotFound => println!("出现错误: 文件不存在"),
                _ => println!("出现错误: {}", e),
            }
        }
    }
    
    println!("完成后退出");
}